Skip to content

Conversation

will-v-pi
Copy link
Contributor

Fixes #878 by adding an assertion that the ordering of pins in bi_pins_with_names is correct

The pins are passed as a pin mask, so there is no ordering, and therefore the pins must be given in ascending order else the names will be associated with the wrong pins

This breaks compilation of the pio/spi/spi_flash example, as the pins there are not in order - given the default pins could be in any order depending on the board, that example should probably be modified to have 4 separate bi_1pin_with_name lines instead of a single bi_4pins_with_names

@lurch
Copy link
Contributor

lurch commented Aug 21, 2024

Huhhh. Rather than break the "external API", I guess a better approach might be to reorder the names so that they're in the same order as the pins? Put perhaps the usage of macros instead of functions means that you can't do that? 🤔

@will-v-pi
Copy link
Contributor Author

Oh yeah, that's a nicer idea - I think that's possible with macros, so I'll try that

@will-v-pi
Copy link
Contributor Author

#1858 used instead

@will-v-pi will-v-pi closed this Aug 22, 2024
@will-v-pi will-v-pi deleted the bi-pins-order-assert branch December 12, 2024 13:53
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants